//
//  AllHeroView.m
//  WhoElse
//
//  Created by 孙宇鹏 on 15/11/18.
//  Copyright © 2015年 sunsystem. All rights reserved.
//

#import "AllHeroView.h"

@implementation AllHeroView

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        [self updateGUI];
    }
    return self;
}

-(void)updateGUI{
    
    self.backgroundColor = [UIColor whiteColor];
    
    //
    self.searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, kWidth, 44)];
    self.searchBar.placeholder = @"请输入英雄关键字";
    self.searchBar.showsCancelButton = YES;
    [self addSubview:self.searchBar];
    
    //
    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
    layout.sectionInset = UIEdgeInsetsMake(5, 10, 5, 10);
    layout.minimumLineSpacing = 10;
    layout.itemSize = CGSizeMake((kWidth - 50) / 4, 100);
    
    self.collectionV = [[UICollectionView alloc]initWithFrame:CGRectMake(0, MaxY(self.searchBar), kWidth, HEIGHT(self) - MaxY(self.searchBar)) collectionViewLayout:layout];
    self.collectionV.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.collectionV];

}

@end
